<form id="pagerForm" method="post" action="<?php echo SITE_URL . 'index.php?c='.$controller;?>">
    <input type="hidden" name="pageNum" value="1" />
    <input type="hidden" name="numPerPage" value="<?php echo $list['pager']->per_page;?>" />
    <input type="hidden" name="title" value="<?php echo $_input->post('title');?>" />
    <input type="hidden" name="source_id" value="<?php echo $_input->post('source_id');?>" />
    <input type="hidden" name="category_id" value="<?php echo $_input->post('category_id');?>" />
    <input type="hidden" name="status" value="<?php echo $_input->post('status');?>" />
    <input type="hidden" name="p_stime" value="<?php echo $_input->post('p_stime');?>" />
    <input type="hidden" name="p_etime" value="<?php echo $_input->post('p_etime');?>" />
    <input type="hidden" name="u_stime" value="<?php echo $_input->post('u_stime');?>" />
    <input type="hidden" name="u_etime" value="<?php echo $_input->post('u_etime');?>" />
</form>


<div class="pageHeader">
    <form onsubmit="return navTabSearch(this);" action="<?php echo SITE_URL . 'index.php?c='.$controller;?>" method="post">
        <div class="searchBar">
            <table class="searchContent">
                <tr>
                    <td>
                        资讯名称：<input type="text" name="title" size="45" value="<?php echo $_input->post('title');?>"/>
                    </td>
                    <td>
                        <select class="combox" name="source_id">
                            <option value="">所有来源</option>
                            <?php
                            foreach($source_list as $k=>$v){
                                ?>
                                <option value="<?php echo $k; ?>" <?php echo $_input->post('source_id') == $k ? 'selected="true"' : ''; ?>><?php echo $v; ?></option>
                            <?php
                            }
                            ?>
                        </select>
                        <select class="combox" name="category_id">
                            <option value="">所有类别</option>
                            <?php
                            foreach($category_list as $k=>$v){
                                ?>
                                <option value="<?php echo $k; ?>" <?php echo $_input->post('category_id') == $k ? 'selected="true"' : ''; ?>><?php echo $v; ?></option>
                            <?php
                            }
                            ?>
                        </select>
                        <select class="combox" name="status">
                            <option value="">所有状态</option>
                            <?php
                            foreach($status_list as $k=>$v){
                                ?>
                                <option value="<?php echo $k; ?>" <?php echo $_input->post('status') == $k ? 'selected="true"' : ''; ?>><?php echo $v; ?></option>
                            <?php
                            }
                            ?>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>
                        发布日期：<input type="text" class="date" name="p_stime" readonly="true" datefmt="yyyy-MM-dd HH:mm:ss" value="<?php echo $_input->post('p_stime');?>" />&nbsp;&nbsp;-&nbsp;&nbsp;
                        <input type="text" class="date" name="p_etime" readonly="true" datefmt="yyyy-MM-dd HH:mm:ss" value="<?php echo $_input->post('p_etime');?>" />
                    </td>
                    <td>
                        修改日期：<input type="text" class="date" name="u_stime" readonly="true" datefmt="yyyy-MM-dd HH:mm:ss" value="<?php echo $_input->post('u_stime');?>" />&nbsp;&nbsp;-&nbsp;&nbsp;
                        <input type="text" class="date" name="u_etime" readonly="true" datefmt="yyyy-MM-dd HH:mm:ss" value="<?php echo $_input->post('u_etime');?>" />
                    </td>
                </tr>
            </table>
            <div class="subBar">
                <ul>
                    <li><div class="buttonActive"><div class="buttonContent"><button type="submit">查询</button></div></div></li>
                </ul>
            </div>
        </div>
    </form>
</div>
<div class="pageContent">
<div class="panelBar">
    <ul class="toolBar">
        <li><a class="add" href="<?php echo SITE_URL . 'index.php?c='.$controller.'&a=add';?>" target="dialog" height="550" width="900" rel="add_cate"><span>添加</span></a></li>
        <li class="line">line</li>
        <li><a class="delete" href="<?php echo SITE_URL . 'index.php?c='.$controller.'&a=del';?>&new_id={sid}" target="ajaxTodo" title="确定要删除吗?"><span>删除</span></a></li>
        <li class="line">line</li>
        <li><a class="edit" href="<?php SITE_URL . 'index.php?c='.$controller.'&a=edit';?>&new_id={sid}" target="dialog" mask="true" height="550" width="900"><span>修改</span></a></li>
    </ul>
</div>
<table class="table" width="100%" layoutH="163">
    <thead>
        <tr>
            <th width="30" align="center">ID</th>
            <th width="160" align="center">资讯名称</th>
            <th width="80" align="center">来源</th>
            <th width="50" align="center">类别</th>
            <th width="50" align="center">状态</th>
            <th width="50" align="center">更新日期</th>
            <th width="50" align="center">发布日期</th>
            <th width="100" align="center">操作</th>
        </tr>
    </thead>
    <tbody>
    <?php foreach($list['rs'] as $v){?>
        <tr target="sid" rel="<?php echo $v['new_id'];?>" >
            <td><?php echo $v['new_id'];?></td>
            <td><?php echo $v['title'];?></td>
            <td><?php echo changeShow($v['source_id'],$source_list);?></td>
            <td><?php echo changeShow($v['category_id'],$category_list);?></td>
            <td style="color:<?php echo changeShow($v['status'],$status_color_list);?>"><?php echo changeShow($v['status'],$status_list);?></td>
            <td><?php echo $v['update_time'];?></td>
            <td><?php echo $v['published'];?></td>
            <td>
                <a href="<?php echo SITE_URL . 'index.php?c='.$controller.'&a=recommend&type=index';?>&new_id=<?php echo $v['new_id'];?>" target="ajaxTodo" rel="recommend_index_new" title="确定要将这条资讯推荐到首页吗?">首页</a> |
                <a href="<?php echo SITE_URL . 'index.php?c='.$controller.'&a=recommend&type=list';?>&new_id=<?php echo $v['new_id'];?>" target="ajaxTodo" rel="recommend_list_new" title="确定要将这条资讯推荐到列表页吗?">列表页</a> |
                <a href="<?php echo SITE_URL . 'index.php?c='.$controller.'&a=edit';?>&new_id=<?php echo $v['new_id'];?>" target="dialog" mask="true" height="550" width="900" rel="edit_new">编辑</a> |
                <a href="<?php echo SITE_URL . 'index.php?c='.$controller.'&a=del';?>&new_id=<?php echo $v['new_id'];?>" target="ajaxTodo" title="确定要删除吗?">删除</a>
            </td>
        </tr>
    <?php }?>
    </tbody>
</table>
<div class="panelBar">
    <div class="pages">
        <span>显示</span>
        <?php
        $_pager_num_type = array(30,50,100);
        ?>
        <select class="combox" name="numPerPage" change="navTabPageBreak({numPerPage:this.value})" param="numPerPage">
            <?php
            foreach($_pager_num_type as $v){
                echo '<option value="'.$v.'" '.($list['pager']->per_page == $v ? 'selected':'').'>'.$v.'</option>';
            }
            ?>
        </select>
        <span>条，共<?php echo $list['pager']->getTotalCount();?>条</span>
    </div>
    <div class="pagination" targetType="navTab" totalCount="<?php echo $list['pager']->getTotalCount();?>" numPerPage="<?php echo $list['pager']->per_page;?>" pageNumShown="5" currentPage="<?php echo $list['pager']->curr_page;?>"></div>
</div>
</div>
<!--通用处理js-->
<script type="text/javascript" src="<?php echo SITE_URL . 'theme/js/v1/admin_common.js'; ?>"></script>